<%--
  Created by IntelliJ IDEA.
  User: liuyanzhao
  Date: 2022/4/9
  Time: 9:57 上午
  报修详情
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ include file="../common/head.jsp" %>


<!-- ============================ User Dashboard ================================== -->
<section class="p-0">
    <div class="container-fluid p-0">

        <div class="row">

            <%@ include file="../common/admin-left.jsp" %>


            <div class="col-lg-9 col-md-8 col-sm-12">


                <!-- ============================ Submit Property Start ================================== -->
                <section style="padding-top: 10px;">

                    <div class="container">
                        <div class="row">

                            <!-- Submit Form -->
                            <div class="col-lg-12 col-md-12">

                                <div class="submit-page form-simple">

                                    <!-- Basic Information -->
                                    <div class="frm_submit_block">
                                        <h3>报修详情</h3>
                                        <div class="frm_submit_wrap">
                                            <form action="" id="form">
                                                <div class="form-row">

                                                    <input type="hidden" name="id" value="${maintain.id}">
                                                    <input type="hidden" id="key" name="key">
                                                    <input type="hidden" name="houseId" value="${maintain.houseId}">
                                                    <div class="form-group col-md-12">
                                                        <label><strong style="color: black">报修人</strong></label>
                                                        <p>${maintain.user.userDisplayName}</p>
                                                    </div>
                                                    <div class="form-group col-md-12">
                                                        <label><strong style="color: black">房屋信息</strong></label>
                                                        <p><a href="/house/detail/${maintain.houseId}">${maintain.house.title}</a></p>
                                                    </div>

                                                    <div class="form-group col-md-12">
                                                        <label><strong style="color: black">标题</strong></label>
                                                        <p>${maintain.title}</p>
                                                    </div>


                                                    <div class="form-group col-md-12">
                                                        <label><strong style="color: black">内容</strong></label>
                                                        <p>${maintain.content}</p>
                                                    </div>

                                                    <div class="form-group col-md-12">
                                                        <label><strong style="color: black">图片</strong></label>
                                                        <p>
                                                            <c:forEach items="${maintain.imgUrlList}" var="img">
                                                                <img src="${img}" alt="" width="100%">
                                                            </c:forEach>
                                                        </p>
                                                    </div>

                                                    <div class="form-group">
                                                        <div class="col-lg-12 col-md-12">
                                                            <a class="btn" href="/admin/maintain">返回</a>
                                                        </div>
                                                    </div>

                                                </div>
                                            </form>
                                        </div>
                                    </div>


                                </div>
                            </div>

                        </div>
                    </div>

                </section>
                <!-- ============================ Submit Property End ================================== -->

            </div>
        </div>
    </div>
</section>
<!-- ============================ User Dashboard End ================================== -->


<%@ include file="../common/footer.jsp" %>
<script src="/assets/plugins/bootstrap-fileinput/js/fileinput.min.js"></script>
<script src="/assets/plugins/bootstrap-fileinput/js/locales/zh.js"></script>
<script>
    $(function () {
        var timestamp = Date.parse(new Date());
        $('#key').val(timestamp);
        var control = $("#file");
        var uploadUrl = "/file/upload?key=" + timestamp;
        control.fileinput({
            language: 'zh', //设置语言
            uploadUrl: uploadUrl, //上传的地址
            allowedFileExtensions: ['png', 'jpeg', 'jpg', 'gif'],//接收的文件后缀
            showUpload: true, //显示批量上传按钮
            showCaption: false,//是否显示标题
            browseClass: "btn btn-primary", //按钮样式
            dropZoneEnabled: true,//是否显示拖拽区域
            //minImageWidth: 50, //图片的最小宽度
            //minImageHeight: 50,//图片的最小高度
            //maxImageWidth: 1000,//图片的最大宽度
            //maxImageHeight: 1000,//图片的最大高度
            maxFileSize: 0,//单位为kb，如果为0表示不限制文件大小
            minFileCount: 0,
            maxFileCount: 100,
            enctype: 'multipart/form-data',
            validateInitialCount: true,
            previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",

            msgFilesTooMany: "选择上传的文件数量({n}) 超过允许的最大数值{m}！",
        });
        //导入文件上传完成之后的事件
        $("#file").on("fileuploaded", function (event, data, previewId, index) {
            // alert('上传成功');
        });
    });
</script>
</body>
</html>
